<?php

class PeopleController extends Zend_Controller_Action
{

    public function init()
    {
        /* Initialize action controller here */
    }

    public function indexAction()
    {
        $form = new Application_Form_People();
        $form->submit->setLabel('Add');
        $this->view->form = $form;
        if ($this->getRequest()->isPost()) {
            $formData = $this->getRequest()->getPost();
            if ($form->isValid($formData)) {
                $death_reason = $form->getValue('deathReason'); 
$gender = $form->getValue('gender');  
$mother_id = $form->getValue('motherId'); 
$father_id = $form->getValue('fatherId');
$narrative = $form->getValue('narrative'); 
        $updated    = $form->getValue('updated'); 
        $creator_id    = $form->getValue('creatorId');  
          $created  = $form->getValue('created');  
           $editor_id  = $form->getValue('editorId');
                $users = new Application_Model_People();
                $users->addUser($death_reason, $gender, $mother_id, $father_id, $narrative, $updated, $creator_id, $created, $editor_id);
                $this->_helper->redirector('index');
            } else {
                $form->populate($formData);
            }
        }
    }


}

